import { apiurl } from './config.js'

export default (options)=>{
	/*
	options = {
				url:'http://localhost:3000/api/getcate',
			}
	*/
   
	return new Promise((resolve,reject)=>{
		uni.request({
			url: apiurl + options.url,
			data:options.data || {},
			header:options.header || {
				'content-type':'application/x-www-form-urlencoded'
			},
			method:options.method || 'GET',
			success:resolve,
			fail:reject
		})
	})
}